<template>
  <a-config-provider :locale="locale">
    <transition name="fade">
      <component :is="layout"></component>
    </transition>
  </a-config-provider>
</template>
<script setup lang="ts">
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import Basic from '@/layout/basic.vue'
import Blank from '@/layout/blank.vue'
import Screen from '@/layout/screen.vue'
dayjs.locale('zh-cn')

const locale = zhCN
const route = useRoute()

const layout = computed(() => {
  let ly = Basic
  if (route.meta.layout === 'blank') ly = Blank
  if (route.meta.layout === 'screen') ly = Screen
  return ly
})
</script>
<style lang="scss" scoped></style>
